<?php 

include './Core/function.php';

$db = include "./db.php";

$id = $_GET['id'];

if($_POST!=null){
	$msgid = intval($_POST['msgid']);
	$arr['username'] = $_POST['username'];
	$arr['info'] = $_POST['info'];
    $db[$msgid] = $arr;
    $str = var_export($db,True);
	$str = "<?php 
	return  ". $str ." 
	?>";
	file_put_contents('./db.php', $str);
	success('index.php','修改成功');
}

if($id!=null){
    //获得对应的信息
    $username = $db[$id]["username"];
    $info = $db[$id]['info'];
    include "./Tpl/edit.html";
}else{
	error("index.php","非法操作");
}













 ?>